<?php
namespace app\model;

use think\Model;

class SmsLogModel extends Model
{
    // 定义主键字段q
    protected $pk = 'id';
    // 定义表名
    protected $name = 'sms_code_log';
    // 开启自动写入时间戳
    protected $autoWriteTimestamp = true;

    // 清空某个手机号的验证码记录
    public function deleteSmsCode($mobile)
    {
        $this->where('mobile', '=', $mobile)->delete();
    }
}
